﻿/*
 * Author: Mattan360
 * Contributors:
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using Irrlicht.Net.Video;

namespace Irrlicht.Net.Scene
{
    /// <summary>
    /// A scene node for displaying terrain using the geo mip map algorithm.
    /// The code for the TerrainSceneNode is based on the Terrain renderer by Soconne and the GeoMipMapSceneNode developed by Spintz.
    /// They made their code available for Irrlicht and allowed it to be distributed under this licence. I only modified some parts.
    /// A lot of thanks go to them.
    /// This scene node is capable of very quickly loading terrains and updating the indices at runtime to enable viewing very large terrains.
    /// It uses a CLOD (Continuous Level of Detail) algorithm which updates the indices for each patch based on a LOD (Level of Detail) which is determined based on a patch's distance from the camera.
    /// The Patch Size of the terrain must always be a size of ( 2^N+1, i.e. 8+1(9), 16+1(17), etc. ).
    /// The MaxLOD available is directly dependent on the patch size of the terrain.
    /// LOD 0 contains all of the indices to draw all the triangles at the max detail for a patch. As each LOD goes up by 1 the step taken, in generating indices increases by - 2^LOD, so for LOD 1, the step taken is 2, for LOD 2, the step taken is 4, LOD 3 - 8, etc.
    /// The step can be no larger than the size of the patch, so having a LOD of 8, with a patch size of 17, is asking the algoritm to generate indices every 2^8 ( 256 ) vertices, which is not possible with a patch size of 17.
    /// The maximum LOD for a patch size of 17 is 2^4 ( 16 ).
    /// So, with a MaxLOD of 5, you'll have LOD 0 ( full detail ), LOD 1 ( every 2 vertices ), LOD 2 ( every 4 vertices ), LOD 3 ( every 8 vertices ) and LOD 4 ( every 16 vertices ).
    /// </summary>
    public sealed class TerrainSceneNode : SceneNode
    {
        #region PInvoke
        #endregion

        public TerrainSceneNode(IntPtr pointer)
            : base(pointer)
        { }
    }
}
